package com.xinjiang.electricpower.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xinjiang.electricpower.domain.DTO.WorkOrderPoolDTO;
import com.xinjiang.electricpower.domain.XjOrderGeneral;
import com.xinjiang.electricpower.domain.vo.AuthInfoVo;
import com.xinjiang.electricpower.domain.vo.WorkOrderPoolSummaryVO;
import com.xinjiang.electricpower.domain.vo.WorkOrderStatisticsStatusVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author feizhao
 * @date 2022/11/11
 * @apiNote 工单池Mapper接口
 */
public interface WorkOrderPoolMapper extends BaseMapper<XjOrderGeneral> {

    /**
     *工单池按照各个类型汇总待办工单
     * @return  List<WorkOrderPoolSummaryVO> 返回汇总数据
     */
    @Select("select null type , count(type) num from xj_order_general " +
            " ${ew.customSqlSegment} ")
    List<WorkOrderPoolSummaryVO> selectXjOrderGeneralByStatus(@Param("ew") QueryWrapper<WorkOrderPoolSummaryVO> wrapper);

    /**
     * 统计工单池-工单占比状态
     * @param workOrderPoolDTO
     * @param authStr
     * @return
     */
    List<WorkOrderStatisticsStatusVO> getOrderPoolStatusCount(@Param("dto")WorkOrderPoolDTO workOrderPoolDTO,@Param("auth")AuthInfoVo authStr);
}
